<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PanelList.ascx.cs" Inherits="admin_webparts_Plug_ins_Panel_PanelList" %>

<%@ Import Namespace="NTTHAO.Web.BL.Panel" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("PANEL_GROUP_INFO", Session)%></h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>

<%if (this._Group != null) { %>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("NAME", Session)%>:
        </td>
        <td><b><%=this._Group.Name%></b>
        </td>
    </tr>
    <tr class="odd">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("DEFAULT_SIZE", Session)%>:
        </td>
        <td><%=this._Group.DefaultWidth%> x <%=this._Group.DefaultHeight%> pixels</td>
    </tr>
    <tr class="even">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("MAX_SIZE", Session)%>:
        </td>
        <td><%=this._Group.MaxWidth%> x <%=this._Group.MaxHeight%> pixels</td>
    </tr>
    <tr class="odd">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("IMAGE_PATH", Session)%>:
        </td>
        <td><%="/" + this._Group.ImagePath %></td>
    </tr>
    <tr class="even">
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%>:</td>
        <td><%=(this._Group.Actived ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
    </tr>
</table>
<div class="tip">
	<h2 style="padding-top: 0px;"><%=LanguageUtility.GetLanguageText("IMAGE_LIST", Session)%></h2>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
        <td align="left" style="padding-bottom: 10px;">
            <span id="addLink" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddi"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=imageadd&groupid=<%=this._Group.ID %>" tabindex="0" id="loggerLink-button"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
            <script type="text/javascript">
                YAHOO.util.Event.onContentReady("addLink", function () {
                        var oAddLink = new YAHOO.widget.Button("addLink");
                    });
            </script>
        </td>
    </tr>
    <tr>
        <td align="left">
            <table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
                <tr>
                    <th width="42px">#</th>
                    <th><%=LanguageUtility.GetLanguageText("TITLE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("IMAGE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("IMAGE_URL", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("LINK", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
                    <th width="42px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
                </tr>
                <%if (this._ImageList != null) for (int i = 0; i < this._ImageList.Rows.Count; i++) {
                      System.Data.DataRow row = this._ImageList.Rows[i];
                      string image = row[NTTHAO.Web.BL.Panel.Panel.FILENAME__COLUMN_NAME].ToString();
                %>
                <tr class="<%=(i%2==1?"even":"odd") %>">
                    <td align="center"><%=i + 1 %></td>
                    <td align="left"><b><%=row[NTTHAO.Web.BL.Panel.Panel.TITLE__COLUMN_NAME] %></b></td>
                    <td align="center"><%if (image.Length > 0) { %><a target="_blank" href="../<%=this._Group.ImagePath + row[NTTHAO.Web.BL.Panel.Panel.FILENAME__COLUMN_NAME].ToString() %>"><img src="ImageProvider.aspx?imgurl=<%=Server.UrlEncode(this._Group.ImagePath + row[NTTHAO.Web.BL.Panel.Panel.FILENAME__COLUMN_NAME].ToString())%>" alt="" style="max-width: 100px; max-height: 75px;" /></a><%} else { %>&nbsp;<%} %></td>
                    <td align="center"><a target="_blank" href="../<%=this._Group.ImagePath + row[NTTHAO.Web.BL.Panel.Panel.FILENAME__COLUMN_NAME].ToString() %>">/<%=this._Group.ImagePath + row[NTTHAO.Web.BL.Panel.Panel.FILENAME__COLUMN_NAME].ToString()%></a></td>
                    <td align="left"><a target="_blank" href="<%=row[NTTHAO.Web.BL.Panel.Panel.LINK__COLUMN_NAME] %>"><%=row[NTTHAO.Web.BL.Panel.Panel.LINK__COLUMN_NAME]%></a></td>
                    <td align="center"><%=((int)row[NTTHAO.Web.BL.Panel.Panel.ACTIVED__COLUMN_NAME] == 1 ? "<img src=\"resources/images/active_l.png\" />" : "<img src=\"resources/images/inactive_l.png\" />")%></td>
                    <td align="left">
                        <ul class="icon" style="width: 112px;">
                            <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=imageedit&groupid=<%=Request.QueryString["groupid"] %>&imageid=<%=row[NTTHAO.Web.BL.Panel.Panel.ID__COLUMN_NAME] %>" class="icon editbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=imagedel&groupid=<%=Request.QueryString["groupid"] %>&imageid=<%=row[NTTHAO.Web.BL.Panel.Panel.ID__COLUMN_NAME] %>" class="icon deletebn" onclick="javascript: return confirm('<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace("<br />", "\\n")%>');">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=moveimageup&groupid=<%=Request.QueryString["groupid"] %>&imageid=<%=row[NTTHAO.Web.BL.Panel.Panel.ID__COLUMN_NAME] %>" class="icon ascbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=moveimagedown&groupid=<%=Request.QueryString["groupid"] %>&imageid=<%=row[NTTHAO.Web.BL.Panel.Panel.ID__COLUMN_NAME] %>" class="icon descbn">&nbsp</a></li>
                        </ul>
                    </td>
                </tr>
                <%} %>
            </table>
        </td>
    </tr>
</table>
<%} %>
